package com.mybatis.Command.imp;

import org.apache.ibatis.session.SqlSession;

import com.mybatis.SqlSessionFactory.SessionManager;
import com.mybatis.pojo.user;
import com.mybatis.util.QingkeConsole;

public class InsertCommand {
     public static void main(String[] args){
    	
    	 SqlSession session =SessionManager.getInstance().getSession();
    	 
    	 
    	 String insertSql = "com.mybatis.dao.userMapper.insert";
    	 String name = QingkeConsole.askUserInput("Please enter your name");
    	 user user = new user();
    	 user.setName(name);
    	 session.insert(insertSql, user);
    	 session.commit();
    	 session.close();
     }
	

}
